package logic;

import java.util.logging.Logger;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import storage.*;
import testing.BlastedLogger;
import ui.*;

public class TaskMaster {

	private final static Logger LOGGER = Logger.getLogger(TaskMaster.class
			.getName());

	public static void main(String[] args) {
		try {
			BlastedLogger.setup();
		} catch (Exception e) {
			e.printStackTrace();
			throw new RuntimeException("Problems with creating the log files");
		}

		TaskMemoryController.init();
		TaskDirector director = new TaskDirector();

		Display display = new Display();
		Shell shell = new Shell(display);
		GUI gui = new GUI(shell, SWT.NONE, display);
		gui.pack();
		shell.pack();
		shell.setText("TASK_MASTER");
		shell.open();
		gui.IntialDisplay(director);
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
	}
}